package cn.linjianhui.thread.callable;

import java.util.concurrent.Callable;

public class RealData implements Callable<String> {

    private final String para;

    public RealData(String para) {
        this.para = para;
    }


    @Override
    public String call() throws Exception {
        // RealData的构造可能很慢，需要用户等待很久，这里用Sleep模拟
        StringBuilder sb = new StringBuilder();
        for(int i = 1; i <= 10; i++) {
            sb.append(this.para);
            try{
                Thread.sleep(100);
            }catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        return sb.toString();
    }
}
